<template>
	<uni-forms-item label="最大长度" name="maxlength">
		<uni-easyinput v-model="formData.maxlength" type="text" placeholder="请输入" :disabled="disabled"
			:cursorSpacing="20" />
	</uni-forms-item>
	<uni-forms-item label="默认值" name="defaultVal">
		<uni-easyinput v-model="formData.defaultVal" type="textarea" placeholder="请输入" :disabled="disabled"
			:cursorSpacing="20">
			<template #right>
				<view class="textarea_length_tip">{{ formData.defaultVal?.length || 0 }} / {{ formData.maxlength }}</view>
			</template>
		</uni-easyinput>
	</uni-forms-item>

</template>

<script setup>
const props = defineProps({
	disabled: Boolean
})
const formData = defineModel()
</script>

<style scoped lang="scss">
.textarea_length_tip {
	padding: 0 10rpx;
	color: $uni-text-color-grey;
	position: absolute;
	right: 2px;
	bottom: -20px;
}
</style>